<%@ page language="Java" import="java.util.*,descriptor.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%
	CompanySupsListDescriptor compSupList = (CompanySupsListDescriptor)request.getAttribute("compSupList");
	StudentDescriptor student = (StudentDescriptor)request.getAttribute("student");
	OfferDescriptor offer =(OfferDescriptor)request.getAttribute("offer");
	String result =(String)request.getAttribute("result");
	RecruiterDescriptor recruiter = (RecruiterDescriptor)request.getAttribute("recruiter");
	if(recruiter == null){
		response.sendRedirect("index.jsp");
	}

%>
<html>
	<jsp:include page="recruiterHeader.jsp" >
		<jsp:param name="pageTitle" value="Work Placement Management System - Recruiter" />
	</jsp:include>
	<body OnLoad="showmenu(document.getElementById('smenu2'));">
		<jsp:include page="recruiterPageHeader.jsp"></jsp:include>
		<div id="container">
			<jsp:include page="recruiterMenu.jsp" ></jsp:include>
			<div id="content">
			<h3 class="posttitle">Description of the offer <%=offer.getName()%></h3>
				<div class="entry">
				
		<h3><%=result%></h3>
		<form action="RecruiterServlet?page=UpdateOfferDone&amp;offerId=<%=offer.getId()%>" method="post">
		Type :<% if(offer.getType()==0) {
		%>Private <br/>
		Offer made to : <%=student.getFirstName()%> <%=student.getSurName()%><br/>
		<%
		}else{
		%>
		Public<br/>
		<%
		}
		%>
		
		Title of the offer :
		<input type="text" name="title" value="<%=offer.getName()%>" /><br/>
Workplacement Date of start : 
		<input type="text" id="calendar" name="calendar1" value="<%=offer.getDateOfStart()%>" />
    <button id="trigger">Choose the date</button>
    <script type="text/javascript">//<![CDATA[
      Zapatec.Calendar.setup({
        firstDay          : 1,
        range             : [2007.01, 2999.12],
        electric          : false,
        inputField        : "calendar",
        button            : "trigger",
        ifFormat          : "%A, %B %d, %Y",
        daFormat          : "%Y/%m/%d"
      });
    //]]></script><br/>
Workplacement Date of End : 
		<input type="text" id="calendar" name="calendar2" value="<%=offer.getDateOfEnd()%>" />
    <button id="trigger">Choose the date</button>
    <script type="text/javascript">//<![CDATA[
      Zapatec.Calendar.setup({
        firstDay          : 1,
        range             : [2007.01, 2999.12],
        electric          : false,
        inputField        : "calendar",
        button            : "trigger",
        ifFormat          : "%A, %B %d, %Y",
        daFormat          : "%Y/%m/%d"
      });
    //]]></script><br/>
<br/>
Choose the CompanySupervisor :
<select name="companySup">
<%
CompanySupDescriptor offerCompSup = compSupList.getCompanySup(offer.getCompanySup());
for (CompanySupDescriptor compSup : compSupList.getCompanySupDescriptors()){

%>
<option value ="<%=compSup.getUserId()%>" <%if(offerCompSup.getUserId()==compSup.getUserId()){%>selected<%}%> ><%=compSup.getFirstName()%> <%=compSup.getName()%>   </option>
<%
}
%>
</select>
<br/><br/>
Interview :<br/>
Day of the interview: 
<input type="text" id="calendar" name="interviewDay" value="<%=offer.getDateOfInterview()%>"/>
    <button id="trigger"  >Choose the date</button>
    <script type="text/javascript">//<![CDATA[
      Zapatec.Calendar.setup({
        firstDay          : 1,
        range             : [2007.01, 2999.12],
        electric          : false,
        inputField        : "calendar",
        button            : "trigger",
        ifFormat          : "%A, %B %d, %Y",
        daFormat          : "%Y/%m/%d"
      });
    //]]></script>
<br/>
The Hours:
<select name="hour">
<% for (int i = 0; i<24;i++){
%>
<option value="<%=i%>" <%if(i==Integer.parseInt(offer.getHourOfInterview())){%>selected<%}%>><%=i%></option>
<%
}
%>
</select>
:
<select name="minute">
<% for (int i = 0; i<61;i++){
%>
<option value="<%=i%>" <%if(i==Integer.parseInt(offer.getMinOfInterview())){%>selected<%}%>><%=i%></option>
<%
}
%>
</select><br/>
Address:<br/>
<textarea name="address" rows="10" cols="30">
<%=offer.getAddressOfInterview()%></textarea><br/>

Description : <br/><textarea name="description" rows="20" cols="80">
<%=offer.getDescription()%>
</textarea><br/>
<button name="Send" type="submit"/>Update</button>
</form>



				</div>
	    	</div>
			<jsp:include page="recruiterPageFooter.jsp"></jsp:include>
		</div>
	</body>
</html>